<template>
  <Layout navColor="#fff">
    <web-view :src="webViewUrl" @message="handleWebViewMessage" @load="handleLoad"></web-view>
  </Layout>
</template>

<script>
import config from '@/config.js'
import { formatQuery } from '@/utils/index.js'
export default {
  name: 'H5Check',
  computed: {},
  data() {
    return {
      webViewUrl: ''
    }
  },
  onLoad(opts) {
    console.log('onLoad', opts)

    let query = formatQuery(opts, false)

    console.log('query', query)

    if (config.webView) {
      this.webViewUrl = config.webView + `${query}`
    }
  },
  created() {
    uni.showLoading({
      title: '请稍等...'
    })
  },
  mounted() {},

  methods: {
    handleLoad() {
      uni.hideLoading()
    },
    handleWebViewMessage(e) {
      const messages = e.detail.data || []

      console.log('handleWebViewMessage: ', messages)
    }
  }
}
</script>

<style lang="scss" scoped></style>
